package br.com.ds3.relatorio.util;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperRunManager;

public class RelatorioUtil {
	public static File geraRelatorio(JRDataSource source, String jasperFile) throws JRException {
		Map<String, Object> params = new HashMap<String, Object>();
		String arquivoPdf = JasperRunManager.runReportToPdfFile(jasperFile, params, source);

		File file = new File(arquivoPdf);
		return file;
	}
}
